package practice_3_2;
//递归求 1 + 2 + 3 + ... + 10
public class RecursiveSum {
    public static void main(String[] args) {
        int n = 100;
        System.out.println(reSum(n));
    }
    //递归求和
    public static int reSum(int n){
        //递归结束条件
        if(n == 0){
            return 0;
        }
        return n + reSum(n - 1);
    }
}
